home *** CD-ROM | disk | FTP | other *** search
- unit IEBrowsU;
-
- {$ifdef Windows}
- {$define DelphiLessThan3}
- {$define DelphiLessThan4}
- {$endif}
- {$ifdef Ver90} { Delphi 2.0x }
- {$define DelphiLessThan3}
- {$define DelphiLessThan4}
- {$endif}
- {$ifdef Ver93} { C++ Builder 1.0x }
- {$define DelphiLessThan3}
- {$define DelphiLessThan4}
- {$endif}
- {$ifdef Ver100} { Delphi 3.0x }
- {$define DelphiLessThan4}
- {$endif}
-
- {$ifdef DelphiLessThan3}
- 'Delphi 3 and later only'
- {$endif}
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls, ComObj, ShDocVw_Tlb;
-
- type
- TForm1 = class(TForm)
- btnAbout: TButton;
- btnEasterEgg: TButton;
- btnWin98: TButton;
- Label1: TLabel;
- btnBrowse: TButton;
- edtURL: TEdit;
- procedure btnAboutClick(Sender: TObject);
- procedure btnEasterEggClick(Sender: TObject);
- procedure btnWin98Click(Sender: TObject);
- procedure btnBrowseClick(Sender: TObject);
- private
- { Private declarations }
- public
- IExplore: IWebBrowser;
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- {$ifdef DelphiLessThan4}
- var
- EmptyParam: OleVariant;
- {$endif}
-
- procedure TForm1.btnBrowseClick(Sender: TObject);
- begin
- IExplore := CreateComObject(Class_InternetExplorer) as IWebBrowser;
- (IExplore.Application as IWebBrowserApp).Visible := True;
- IExplore.Navigate(edtURL.Text, EmptyParam,
- EmptyParam, EmptyParam, EmptyParam)
- end;
-
- procedure TForm1.btnAboutClick(Sender: TObject);
- begin
- IExplore := CreateComObject(Class_InternetExplorer) as IWebBrowser;
- (IExplore.Application as IWebBrowserApp).Visible := True;
- IExplore.Navigate('res://shdocvw.dll/about.dlg', EmptyParam,
- EmptyParam, EmptyParam, EmptyParam)
- end;
-
- procedure TForm1.btnEasterEggClick(Sender: TObject);
- var
- Target: OleVariant;
- begin
- IExplore := CreateComObject(Class_InternetExplorer) as IWebBrowser2;
- //Don't need this since Easter Egg comes up in a second (visible) window
- //IExplore.Application.Visible := True;
- Target := 'TheWCEE';
- IExplore.Navigate('res://shdocvw.dll/wcee.htm', EmptyParam,
- Target, EmptyParam, EmptyParam)
- end;
-
- { Windows 98 Easter Egg Instructions
-
- Invoke the Date/Time Properties applet from Control Panel.
- This can be done by invoking Control Panel first, then
- locating the relevant icon and double-clicking it.
- You can also double-click the Clock in your task bar's
- system tray. Alternatively, run one of these command-lines:
-
- COMMAND DATE/TIME
- COMMAND TIMEDATE.CPL
-
- Click on the Time Zone tab
- The next bit relies on some geography knowledge.
- Hold down the Ctrl key and drag Memphis, Egypt and
- drop it on Memphis, Tennessee.
- Now hold down the Ctrl key and drag Memphis, Tennessee and
- drop it on Seattle, USA
-
- If you got the right locations, a window will appear with
- various pictures that come and go, and the credits list
- will scroll by.
-
- There is a soundtrack as well, so turn your speakers up.
-
- You can circumvent all this trickery by making a new
- shortcut on your Windows98 desktop. Make a shortcut with
- a command-line of:
-
- "C:\Windows\Application Data\Microsoft\Welcome\WelData.Exe" You_are_a_real_rascal
-
- Make sure you go back to the properties for this shortcut
- (right-click and choose properties) and set the Run: option
- to say Minimized.
-
- The soundtrack to this Easter Egg is the file
- C:\Windows\Application Data\Microsoft\Welcome\Welcom98.Wav }
- procedure TForm1.btnWin98Click(Sender: TObject);
- var
- WinDir: array[0..MAX_PATH-1] of Char;
- CmdLine: String;
- const
- RelPath = '\Application Data\Microsoft\Welcome\';
- AppName = 'WELDATA.EXE';
- AppParam = 'You_are_a_real_rascal';
- begin
- GetWindowsDirectory(WinDir, MAX_PATH);
- CmdLine := Format('"%s%s%s" %s', [WinDir, RelPath, AppName, AppParam]);
- WinExec(PChar(CmdLine), SW_SHOWMINNOACTIVE);
- end;
-
- {$ifdef DelphiLessThan4}
- initialization
- TVarData(EmptyParam).VType := varError;
- TVarData(EmptyParam).VError := DISP_E_PARAMNOTFOUND
- {$endif}
- end.
-